package com.sr.vo.req;

import com.sr.pojo.SysUser;
import com.sr.vo.BaseForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @author xiaochi
 * @date 2021/12/15 23:21
 * @desc UserUpdateDetailInfoReqVo
 */
@ApiModel("个人详情模块")
@Data
@EqualsAndHashCode(callSuper = true)
public class UserDetailReqVo extends BaseForm<SysUser> {

    @ApiModelProperty("邮箱")
    private String email;// 邮箱

    @ApiModelProperty("性别")
    private Integer sex;// 性别(1.男 2.女)

    @ApiModelProperty("真实名称")
    private String realName;// 真实名称

    @ApiModelProperty("手机号")
    private String phone;// 手机号

    @ApiModelProperty("账户状态")
    private Integer status;// 账户状态(1.正常 2.锁定 )

    /**
     * 获取实例
     * @return 返回实体类
     */
    @Override
    public SysUser buildEntity() {
        SysUser sysUser = new SysUser();
        BeanUtils.copyProperties(this,sysUser);
        sysUser.setUpdateTime(new Date());
        return sysUser;
    }
}
